#!/bin/sh

mkdir -p /data/trac
cd /data/trac
trac-admin $1 initenv
sed -i '$a\[components]\ntracopt.versioncontrol.svn.* = enabled' $1/conf/trac.ini
trac-admin /data/trac/$1 permission add admin TRAC_ADMIN
trac-admin $1/ repository add svn_$1 /data/repo/$1 svn
trac-admin $1/ repository resync svn_$1
tracd --port 8000 --basic-auth="*,/usr/local/bin/.htpasswd,测试环境" /data/trac/$1
